module.exports = (req, res, next) => {
  if (req.method === 'POST' && req.path === '/login') {
    if (req.body.username === 'xingzhi' && req.body.password === '1234') {
      return res.status(200).json({
        code: '200',
        message: '成功',
        data: {
          token: 'xingzhi',
          user: {
            id: '10001',
            avatarUrl: '',
            nickName: '行知',
          },
        },
      });
    } else {
      return res.status(200).json({ code: '-1', message: '用户名或者密码错误' });
    }
  }
  next();
};
